import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ListComponent } from './components/list/list.component';
import { DetailsComponent } from './components/details/details.component';
import { ListService } from './services/list.service';
import { DetailsService } from './services/details.service';
import { CertificationComponent } from './components/certification/certification.component';
const routes: Routes = [
	{
		path: '',
		data: {
			title: '终端中心',
		},
		children: [
			{
				path: '',
				component: ListComponent,
				runGuardsAndResolvers: 'always',
				resolve: {
					list: ListService,
				},
			},
			{
				path: 'detail',
				pathMatch: 'full',
				redirectTo: 'detail/未命名',
			},
			{
				path: 'detail/:name',
				component: DetailsComponent,
				data: {
					title: '终端详情',
				},
				runGuardsAndResolvers: 'always',
				resolve: {
					details: DetailsService,
				},
			},
			{
				path: 'certification',
				component: CertificationComponent,
				data: {
					title: '资产设备认证'
				}
			}
		],
	},
];

@NgModule({
	imports: [RouterModule.forChild(routes)],
	exports: [RouterModule],
})
export class ComputerRoutingModule {}
